﻿Imports System.Windows.Forms
Imports Negocio
Imports Servicios

Public Class Principal

    Private Sub Principal_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        UserToolStripStatusLabel.Text = Current.Usuario.ToString()
    End Sub

    Private Sub Principal_KeyUp(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles Me.KeyDown
        If e.KeyCode = Keys.D AndAlso e.Modifiers = Keys.Control Then
            Dim debug As New frmDebug()
            debug.Show()
        End If

        If e.KeyCode = Keys.B AndAlso e.Modifiers = Keys.Control Then
            InitApp.ConnectionDialog()
        End If

        If e.KeyCode = Keys.P AndAlso e.Modifiers = Keys.Control Then
            Dim panel As New PanelPrincipal()
            panel.Show()
        End If
    End Sub

    Private m_ChildFormNumber As Integer

#Region "Usuario"

    Private Sub UsuariosConsultaToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles UsuariosConsultaToolStripMenuItem.Click
        Dim f = New frmConsultaUsuario()
        f.Show()
    End Sub

    Private Sub LogOutToolStripMenuItem1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles LogOutToolStripMenuItem.Click
        Me.Close()
    End Sub

    Private Sub CambiarClaveToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles CambiarClaveToolStripMenuItem.Click
        Dim f = New frmUsuarioCambioPass(Current.Usuario)
        f.Show()
    End Sub

    Private Sub Principal_FormClosing(ByVal sender As System.Object, ByVal e As FormClosingEventArgs) Handles Me.FormClosing        
        If MessageExt.Show(GesIdiomas.TraduceMensaje("MSGU001").ToString(), MessageBoxButtons.OKCancel) = DialogResult.OK Then
            GesBitacoras.Guardar("ModPrincipal", "MSGB005", New String() {Current.Usuario.Nick})
        Else
            e.Cancel = True
        End If
    End Sub
#End Region

#Region "Idioma"

    Private Sub IdiomaToolStripMenuItem_Click_1(sender As System.Object, e As System.EventArgs) Handles IdiomaToolStripMenuItem.Click
        Dim f = New frmConsultaIdioma()
        f.Show()
    End Sub
    Private Sub IdiomaToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CambiarIdiomaToolStripMenuItem.Click
        Dim f = New frmCambioIdioma()
        f.Show()
    End Sub

#End Region

#Region "Mantenimiento"


    Private Sub BackUpToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BackUpToolStripMenuItem.Click
        Dim f = New frmBackUp()
        f.Show()
    End Sub

    Private Sub RestoreToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RestoreToolStripMenuItem.Click
        Dim f = New frmRestore()
        f.Show()
    End Sub
#End Region

#Region "Perfil"
    Private Sub PerfilToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles PerfilToolStripMenuItem.Click
        Dim f = New frmConsultaPerfil()
        f.Show()
    End Sub
#End Region

#Region "Bitacora"
    Private Sub BitacoraToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles BitacoraToolStripMenuItem.Click
        Dim f = New frmConsultaBitacora()
        f.Show()
    End Sub
#End Region

#Region "Proyectos"
    Private Sub ProyectosToolStripMenuItem1_Click(sender As System.Object, e As System.EventArgs) Handles ProyectosToolStripMenuItem1.Click
        Dim f = New frmConsultaProyectos()
        f.Show()
    End Sub

    Private Sub RecursosToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles RecursosToolStripMenuItem.Click
        Dim f = New frmConsultaRecurso()
        f.Show()
    End Sub
#End Region


End Class
